package com.ffapp.demo.bean;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

import my.StringUtil;

public class HomeTodayAlarmInfoBean extends BasisBean {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /**
     * xais : ["火灾","抢险救援","社会救助","灾害事故","防恐排爆"]
     * yais : [0,0,0,0,0]
     * yaisInt : null
     * yaisDouble : null
     * yaisLong : null
     */

    private String yaisInt;
    private String yaisDouble;
    private String yaisLong;
    private List<String> xais;
    private List<Integer> yais;

    public String getYaisInt() {
        return yaisInt;
    }

    public void setYaisInt(String yaisInt) {
        this.yaisInt = yaisInt;
    }

    public String getYaisDouble() {
        return yaisDouble;
    }

    public void setYaisDouble(String yaisDouble) {
        this.yaisDouble = yaisDouble;
    }

    public String getYaisLong() {
        return yaisLong;
    }

    public void setYaisLong(String yaisLong) {
        this.yaisLong = yaisLong;
    }

    public List<String> getXais() {
        return xais;
    }

    public void setXais(List<String> xais) {
        this.xais = xais;
    }

    public List<Integer> getYais() {
        return yais;
    }

    public void setYais(List<Integer> yais) {
        this.yais = yais;
    }

    @JSONField(serialize = false)
    public int getAlarmCount(){
        int count = 0;
        if(yais == null || yais.size() == 0)return count;
        for(int data:yais){
            count+=data;
        }
        return count;
    }

    public String getAlarmCount_STR(){
        int count = getAlarmCount();
       return StringUtil.AutoGenericCode(count+"",3);
    }
}
